Fix misalignment of RTL text in ellipsized GtkLabel: use layout width if
authorBehdad Esfahbod <behdad@gnome.org>
Mon, 23 Jan 2006 20:00:02 +0000 (20:00 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Mon, 23 Jan 2006 20:00:02 +0000 (20:00 +0000)
2006-01-23  Behdad Esfahbod  <behdad@gnome.org>

        * gtk/gtklabel.c (get_layout_location): Fix misalignment of RTL
        text in ellipsized GtkLabel: use layout width if set, otherwise
        fallback to ink extents width. (#322042)

ChangeLog
ChangeLog.pre-2-10
gtk/gtklabel.c
tests/.cvsignore

index f9660a2742e4f0332db183a75c91f493cb9b6974..71ece708ef05c844f7d925f033eae285a1b5071e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-01-23  Behdad Esfahbod  <behdad@gnome.org>
+
+       * gtk/gtklabel.c (get_layout_location): Fix misalignment of RTL
+       text in ellipsized GtkLabel: use layout width if set, otherwise
+       fallback to ink extents width. (#322042)
+
 2006-01-23  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkassistant.c (compute_last_button_state): Only show the
index f9660a2742e4f0332db183a75c91f493cb9b6974..71ece708ef05c844f7d925f033eae285a1b5071e 100644 (file)
@@ -1,3 +1,9 @@
+2006-01-23  Behdad Esfahbod  <behdad@gnome.org>
+
+       * gtk/gtklabel.c (get_layout_location): Fix misalignment of RTL
+       text in ellipsized GtkLabel: use layout width if set, otherwise
+       fallback to ink extents width. (#322042)
+
 2006-01-23  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkassistant.c (compute_last_button_state): Only show the
index 28cc24e8101ce5c123167dda1838d32768638876..79c5be1c48b22b38c57d1503f9d6031795836ee2 100644 (file)
@@ -2220,11 +2220,19 @@ get_layout_location (GtkLabel  *label,
 
   if (label->ellipsize || priv->width_chars > 0)
     {
+      int width;
       PangoRectangle ink_rect;
 
-      pango_layout_get_extents (label->layout, &ink_rect, NULL);
-
-      req_width = PANGO_PIXELS (ink_rect.width);
+      width = pango_layout_get_width (label->layout);
+      if (width == -1)
+        {
+         pango_layout_get_extents (label->layout, &ink_rect, NULL);
+         req_width = PANGO_PIXELS (ink_rect.width);
+       }
+      else
+       {
+         req_width = PANGO_PIXELS (width);
+       }
     }
   else
     req_width = widget->requisition.width;
index 8ac714c1f77e6f633fd438fc59cdfef10acd810b..cc80c1b81f3883a0ff90a7af3a05ab9dce5b5bc5 100644 (file)
@@ -14,8 +14,10 @@ pixbuf-read
 pixbuf-threads
 simple
 stresstest-toolbar
+floatingtest
 testactions
 testaccel
+testassistang
 testcairo
 testcalendar
 testcellrenderertext